﻿namespace FastCode.Models
{
    /// <summary>
    /// 路由表
    /// </summary>
    public class RouteConfig : BaseModel
    {
        [SugarColumn(IsNullable = true)]
        [UIType(label: "路径")]
        public string? Path { get; set; } = string.Empty;

        [SugarColumn(IsNullable = true)]
        [UIType(label: "菜单名")]
        public string? Label { get; set; } = string.Empty;
        
        [SugarColumn(IsNullable = true)]
        [UIType(label: "组件")]
        public string? Component { get; set; } = string.Empty;

        /// <summary>
        /// 父菜单id
        /// </summary>
        [UIType(label: "父菜单")]
        public int ParentId { get; set; } = 0;
        
        /// <summary>
        /// 菜单顺序
        /// </summary>
        public int Order { get; set; } = 0;
        
        public bool IsShow { get; set; } = true;

        [UIType(label: "菜单布局")]
        public bool IsLayout { get; set; } = true;

        /// <summary>
        /// 子菜单列表（用于树形结构）
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<RouteConfig>? Children { get; set; }
    }

}
